<template>
  <Tabs />
  <el-main>
    <router-view v-slot="{ Component, route }">
      <transition appear name="fade-transform" mode="out-in">
        <keep-alive :include="authStore.keepAliveRouterGet" v-if="isRouterRefresh">
          <component :is="Component" :key="route.path" />
        </keep-alive>
      </transition>
    </router-view>
  </el-main>
</template>

<script setup lang="ts">
import { ref, computed, nextTick, provide, onBeforeUnmount } from 'vue'
import { GlobalStore } from '@/store'
import { AuthStore } from '@/store/modules/auth'
import Tabs from '@/layouts/components/Tabs/index.vue'

const authStore = AuthStore()
const globalStore = GlobalStore()
const themeConfig = computed(() => globalStore.themeConfig)

// 刷新当前页面
const isRouterRefresh = ref(true)
</script>
